<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<script type="text/javascript">
	$(function() {
		$('#menu_edit_form').form({
			url : "${pageContext.request.contextPath}/menu/${action}",
			onSubmit : function() {
				if (!$("#menu_edit_form").form("validate")) {
					$.messager.show({
						title : "提示信息",
						msg : "输入有误，请重新输入...",
						showType : 'slide',
						timeout : 5000
					});
					return false;
				}
			},
			success : function(data) {
				$("#menu_edit_dialog").dialog("close");
				$('#menu_main_list').datagrid("reload");

				$.messager.show({
					title : "提示信息",
					msg : "更新完毕...",
					showType : 'slide',
					timeout : 5000
				});
			}
		});

		$("#menu_edit_ok").click(function() {
			$('#menu_edit_form').submit();
		});

		$("#menu_edit_cancel").click(function() {
			$("#menu_edit_dialog").dialog("close");
		});
	});
</script>

<form id="menu_edit_form" method="post">
	<input name="pid" id="pid" type="hidden" value="${pid}" /> 
	<input id="id" name="id" type="hidden" value="${menu.id }" />
	<c:if test="${action  == 'update'}"><input type="hidden" name="bindable" value="true" /></c:if>
	
	<table
		style="border:0px solid; width: 100%;height: 100%; border-collapse: 0">
		<tr>
			<td>菜单名称</td>
			<td><input class="easyui-validatebox" type="text"
				name="menuname" validType="midLength[2,9]" value="${menu.menuname }"
				invalidMessage="菜单名长度在2到9个字符之间" data-options="required:true" /></td>
		</tr>

		<tr>
			<td>URL</td>
			<td><input class="easyui-validatebox" value="${menu.url}"
				data-options="required:true" type="text" name="url" />
			</td>
		</tr>

		<tr align="center">
			<td colspan="2"><a id="menu_edit_ok" class="easyui-linkbutton"
				data-options="iconCls:'icon-ok'">确定</a> <a id="menu_edit_cancel"
				class="easyui-linkbutton" data-options="iconCls:'icon-cancel'">取消</a>
			</td>
		</tr>
	</table>
</form>
